package com.yh.controller;

import com.yh.model.Book;
import com.yh.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * ClassName:BookController
 * Package:com.yh.controller
 * Time: 2024/6/21
 */

@Controller
@RequestMapping("book")
public class BookController {
    @Autowired
    BookService bookService;

    @RequestMapping("all")
    @ResponseBody
    public List<Book> all() {
        return bookService.selectAll();
    }
}
